import { baseUrl } from './defaultUrl.js'


/* export default function request(url, data = {}, method = 'GET') {
  return new Promise((resolve, reject) => {
    uni.request({
      url: baseUrl + url,
      data,
	  method,
	  header:{
		   'content-type':'application/json'
	   },
      timeout: 1000,
      dataType: 'json',
      success: res => {
        resolve(res)
      },
      fail: err => {
        reject(err)
      }
    })
  })
} */
export default function request(url, data = {}, method = 'GET') {
  return uni.request({
      url: baseUrl + url,
      data,
	  method,
	  header:{
		   'content-type':'application/json'
	   },
      timeout: 10000,
      dataType: 'json',
  })
}